<script type="text/javascript">
    $(document).ready(function(){
        $("#sync_done").hide();
        $("#box_sync").load("<?php echo site_url('sync/get_data');?>", function(response, status, xhr) {
            if (status == "success") {
                clearInterval(dummyLoad);

                $("#welcome_sync").hide();
                $("#sync_done").show();

                window.location = "manager/squad";
            }
        });
        var bar = document.getElementById("bar"),
            fallback = document.getElementById("fallback"),
            loaded = 0;

        var load = function() {
            loaded += 10;
            bar.value = loaded;
            /* The below will be visible if the progress tag is not supported */
            $(fallback).empty().append("HTML5 progress tag not supported: " + loaded + "% loaded");

            if(loaded == 100)
                loaded = 0;
        };

        var dummyLoad = setInterval(function() {
            load();
        } ,500);
    });
</script>

<div id="welcome_sync">
    <div id="box_sync">
        <div><p class="title_high">Sincronizando</p></div>

        <progress id="bar" value="0" max="100">
            <span id="fallback"></span>
        </progress>

        <div id="bubble_sync">
            Estamos actualizando los datos de tu equipo, no tardamos pero mientras... ¡mira mi preciosa sonrisa! :D
            <?php  echo anchor('', img(array('src' => img_theme('mcgannigan/mcgannigan_bla.png')))); ?>
        </div>
    </div>
</div>

<div id="sync_done">
    <div id="box_sync">

        <div id="globo">
            <cabecera2>¡Sincronizado!</cabecera2>
            <?php  echo anchor('', img(array('src' => img_theme('mcgannigan/mcgannigan_bla.png'))), array('class' => 'clase')); ?>
        </div>
    </div>
</div>